package business_opportunity

import (
	"context"
	pb "git.mycaigou.com/gfyx/micro-gfyx-oppty-service/proto/micro_gfyx_oppty_service_proto/micro-gfyx-oppty-service/business_opportunity"
	"git.mycaigou.com/gfyx/micro-gfyx-oppty-service/service/business_opportunity/strategic_monitor"
	"git.myscrm.cn/golang/stark/v4"
)

type strategicMonitorServer struct {
	strategicMonitorService strategic_monitor.StrategicMonitorServiceIface
}

func NewStrategicMonitorServer(
	strategicMonitorService strategic_monitor.StrategicMonitorServiceIface,
) pb.StrategicMonitorServiceServer {
	return &strategicMonitorServer{
		strategicMonitorService: strategicMonitorService,
	}
}

func (s *strategicMonitorServer) SubmitIndustry(ctx context.Context, request *pb.SubmitIndustryRequest) (*pb.SubmitIndustryResponse, error) {
	resp, err := s.strategicMonitorService.SubmitIndustry(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc SubmitIndustry request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetIndustryMonitorList(ctx context.Context, request *pb.GetIndustryMonitorListRequest) (*pb.GetIndustryMonitorListResponse, error) {
	resp, err := s.strategicMonitorService.GetIndustryMonitorList(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetIndustryMonitorList request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetIndustrySubmitList(ctx context.Context, request *pb.GetIndustrySubmitListRequest) (*pb.GetIndustrySubmitListResponse, error) {
	resp, err := s.strategicMonitorService.GetIndustrySubmitList(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetIndustrySubmitList request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) ChangeIndustryMonitorStatus(ctx context.Context, request *pb.ChangeIndustryMonitorStatusRequest) (*pb.ChangeIndustryMonitorStatusResponse, error) {
	resp, err := s.strategicMonitorService.ChangeIndustryMonitorStatus(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc ChangeIndustryMonitorStatus request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetIndustryStat(ctx context.Context, request *pb.GetIndustryStatRequest) (*pb.GetIndustryStatResponse, error) {
	resp, err := s.strategicMonitorService.GetIndustryStat(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetIndustryStat request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) SubmitCompany(ctx context.Context, request *pb.SubmitCompanyRequest) (*pb.SubmitCompanyResponse, error) {
	resp, err := s.strategicMonitorService.SubmitCompany(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc SubmitCompany request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetCompanyMonitorList(ctx context.Context, request *pb.GetCompanyMonitorListRequest) (*pb.GetCompanyMonitorListResponse, error) {
	resp, err := s.strategicMonitorService.GetCompanyMonitorList(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetCompanyMonitorList request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetCompanySubmitList(ctx context.Context, request *pb.GetCompanySubmitListRequest) (*pb.GetCompanySubmitListResponse, error) {
	resp, err := s.strategicMonitorService.GetCompanySubmitList(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetCompanySubmitList request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) ChangeCompanyMonitorStatus(ctx context.Context, request *pb.ChangeCompanyMonitorStatusRequest) (*pb.ChangeCompanyMonitorStatusResponse, error) {
	resp, err := s.strategicMonitorService.ChangeCompanyMonitorStatus(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc ChangeCompanyMonitorStatus request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetCompanyStat(ctx context.Context, request *pb.GetCompanyStatRequest) (*pb.GetCompanyStatResponse, error) {
	resp, err := s.strategicMonitorService.GetCompanyStat(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetCompanyStat request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}

func (s *strategicMonitorServer) GetMonitorResult(ctx context.Context, request *pb.GetMonitorResultRequest) (*pb.GetMonitorResultResponse, error) {
	resp, err := s.strategicMonitorService.GetMonitorResult(ctx, request)
	if err != nil {
		stark.Logger.Errorf(ctx, "grpc GetMonitorResult request:%#v, err:%s", request, err.Error())
		return nil, err
	}
	return resp, nil
}
